import request from "@/utils/request"

/**个人设置页 页面信息 */
export const uSelectUserInfo = (params: {userId: string | number}) =>
	request.get<{devCount: number; user: UserSetting.UserInfo}>("/user/uSelectUserInfo", params)

/**用户详细资料页 */
export const uSelectUserNearName = (params: {userId: string | number}) =>
	request.get<string>("/user/uSelectUserNearName", params)

/**修改昵称 */
export const uEditUserNearName = (params: {userId: string | number; userNearName: string}) =>
	request.get<null>("/user/uEditUserNearName", params)

/**修改公司名称 */
export const uEditUserCompany = (params: {userId: string | number; userCompany: string}) =>
	request.get<string>("/user/uEditUserCompany", params)

/**修改绑定手机号 */
export const uEditUserPhone = (params: {
	userId: string | number
	newUserPhone: string
	verfiyCode: string
}) => request.get<null>("/user/uEditUserPhone", params)

/**用userId和手机号获取验证码  */
export const verifyGetCode = (params: {userId: string | number; userPhone: string}) =>
	request.get<null>("/user/verifyYSJGetCode", params)

/**微信扫码web授权  */
export const wxScan = (params: {address: string; userWeichatId: string}) =>
	request.get<null>("/user/wxYSJScan", params)

/* 修改监控摄像头的名称 */
export const editCameraNameApi = params => {
	return request.post<null>(
		`/user/edit/cameraDataName?cameraId=${params.cameraId}&cameraName=${params.cameraName}`
	)
}
